<?php include '../public/header.php' ?>
<?php include '../public/header_public.php' ?>
<body class="laytp-container">
<div style="height: 45px"></div>
<div id="opt_nav">
</div>
<div id="dialog">
    <div class="page-title" id="page-title">
        <div class="page-title-con">
            <span class="title">关联项目信息</span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_show('查看','{{d.id}}')">查看</a>
    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script>
    var param_neiid = getQueryVariable('neiid') || 0;

    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;


        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });


        setSouTableExport('项目信息');
        var mytable = table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_contract_nei_enginnums_list),where: {neiid:param_neiid}, page: true, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,text: TabInit.text
            ,parseData: function (res) {

                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.data.total,
                    "data": res.data.data.data
                };
            }
            , cols: [[
                {type: "checkbox", fixed: 'left'}
                ,{type:'numbers',title:'序号',fixed:'left'}
                ,{field: 'state_name', title: '项目状态'}
                ,{field:'name',title:'项目名称',templet: function(d){
                        return '<span class="colorlan" onclick="openPage(\'../engin/show.php?id='+d.id+'\')">'+d.name+'</span>';
                    }}
                ,{field: 'number', title: '项目编号'}
                ,{field: 'engintype', title: '项目类型'}
                ,{field: 'jian_unit', title: '建设单位'}
                ,{field: 'areas', title: '所在地'}
                ,{field: 'addr', title: '详细地址'}
                ,{field: 'expectfee', title: '工程造价(万元)'}
                ,{field: 'duration', title: '工期(天)'}
                ,{field: 'startdt', title: '计划开工日期'}
                ,{field: 'enddt', title: '计划竣工日期'}
                ,{field: 'man_xiang_name', title: '项目负责人'}
                ,{field: 'zhaotype', title: '招标方式'}
                ,{field: 'actualdt', title: '实际开工日期'}
                ,{field: 'filishdt', title: '竣工验收日期'}
                ,{fixed: 'right', title:'操作', toolbar: '#test-dropdown-toolbar-barDemo',align:'center',width:200}
            ]]
            , done: function (res) {
                soulTable.render(this);
            }
        });


        listTableSearch(form, table);
    });


    function auth_but_func_show(buttitle, id){
        openPage('../engin/show.php?id='+id);
    }


</script>
</body>
</html>
